Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(opening times): dates with parsed TMB year #860

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

donni106
Copy link
Member

@donni106 donni106 commented Jul 3, 2023

In the future, TMB pois will have adjusted dates for specific cases, being returned from the main server with year 1970. This way we can identify them to adjust checking opening time and rendering.

before after
Simulator Screen Shot - iPhone 12 - 2023-07-03 at 17 20 55 Simulator Screen Shot - iPhone 12 - 2023-07-03 at 17 18 41

In order to test with the POI Eiscafé "Zur Postmeile" you need to set the TMB_YEAR_TO_PARSE to 2020.

SVA-985

- main server returns special TMB data with the year
  of 1970, that we will be able to parse in order to
  check for correct opening times
- added jest tests
  - added expo linking mock for running test successfully
- removed `only` flag for jest test to run all in that
  file
  - added weekday to two checks to fulfill requirements

SVA-985
- main server returns special TMB data with the year
  of 1970, that we will be able to parse in order to
  render without the year

SVA-985
@donni106 donni106 added the enhancement New feature or request label Jul 3, 2023
@donni106 donni106 added this to the 3.2.5 milestone Jul 3, 2023
@donni106 donni106 requested a review from ardasnturk July 3, 2023 15:30
@donni106 donni106 self-assigned this Jul 3, 2023
@what-the-diff
Copy link

what-the-diff bot commented Jul 3, 2023

PR Summary

  • Enhanced Date Parsing in openingHoursHelper.ts
    We've added 'TMB_YEAR_TO_PARSE' and 'dateWithCorrectYear' functions which help decipher the correct year from our date information. This boosts the accuracy of our time-based functionality.

  • Tests for Newly Added Date Parsing Function
    We've also introduced tests for the 'dateWithCorrectYear' function. These validate the functionality and help ensure reliable operations.

  • Tweak to OpeningTimesCard.js
    A new flag 'withoutYear' has been introduced in OpeningTimesCard.js. Depending upon the value of 'TMB_YEAR_TO_PARSE', this flag will help determine the correct date format.

  • Update to momentFormat Import in OpeningTimesCard.js
    The import was updated to recognize 'TMB_YEAR_TO_PARSE', enhancing the efficiency of date and time processing.

  • Update to isOpeningTimeForDate Function
    The function in openingHoursHelper.ts is now equipped to handle correct year parsing, thus providing more reliable outcomes associated with opening times.

  • Mock Update in jest-setup.js
    To streamline testing, jest-setup.js has been updated to mock 'expo-linking' module using a 'createURL' function.

Copy link
Member

@ardasnturk ardasnturk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good.

@ardasnturk ardasnturk merged commit 38a3de6 into master Jul 14, 2023
@ardasnturk ardasnturk deleted the feature/SVA-985-date-with-correct-year branch July 14, 2023 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants